package com.work.crops.feign;

import com.work.crops.pojo.CropsInfoIndex;
import com.work.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("crops")
public interface CropsIndexFeign {

    /**
     * 根据农作物id和生长状态查询农作数据指标
     * @param id    农作物id
     * @param stage 生长状态
     * @return
     */
    @GetMapping("/cropsIndex/{id}")
    public Result<List<CropsInfoIndex>> findById(@PathVariable("id") Integer id, @RequestParam("stage") String stage);

}
